package com.enjoy.concurrent.ch2.forkjoin.sum;

/**
 * 单线程执行累加
 */
public class SumNormal {
    public static void main(String[] args) {
        long count = 0;
        int[] src = MakeArray.makeArray();

        long start = System.currentTimeMillis();

        for (int j : src) {
//            try {
//                Thread.sleep(1);
//            } catch (InterruptedException e) {
//                throw new RuntimeException(e);
//            }
            count = count + j;
        }

        System.out.println("The count is " + count + " spend time:" + (System.currentTimeMillis() - start) + "ms");
    }
}
